<template>
  <div id="index" ref="appRef">
    <div class="bg">
      <dv-loading v-if="loading">加载中...</dv-loading>
      <div v-else class="host-body">

        <div class="d-flex jc-center">
          <dv-decoration-10 class="dv-dec-10" />
          <div class="d-flex jc-center">
            <dv-decoration-8 class="dv-dec-8" :color="decorationColor" />
            <div class="title">
              <span class="title-text">大数据可视化平台</span>
              <dv-decoration-6
                class="dv-dec-6"
                :reverse="true"
                :color="['#50e3c2', '#67a1e5']"
              />
            </div>
            <dv-decoration-8
              class="dv-dec-8"
              :reverse="true"
              :color="decorationColor"
            />
          </div>
          <dv-decoration-10 class="dv-dec-10-s" />
        </div>

        <!-- 第二行 -->
        <div class="d-flex jc-between px-2">
          <div class="d-flex aside-width">
            <div class="react-left ml-4 react-l-s">
              <span class="react-left"></span>
              <span class="text">数据分析一</span>
            </div>
            <div class="react-left ml-3">
              <span class="text">数据分析二</span>
            </div>
          </div>
          <div class="d-flex aside-width">
            <div class="react-right bg-color-black mr-3">
              <span class="text fw-b">数据分析三</span>
            </div>
            <div class="react-right mr-4 react-l-s">
              <span class="react-after"></span>
              <span class="text"
              >{{ dateYear }} {{ dateWeek }} {{ dateDay }}</span
              >
            </div>
          </div>
        </div>

        <!-- 主要内容 -->
        <div class="body-box">
          <!-- 第三行数据 -->
          <div class="content-box">
            <div>
              <dv-border-box-1>
                <page1Left1 :project-id="this.projectId - 0" />
              </dv-border-box-1>
            </div>
            <div>
              <dv-border-box-8>
                <page1Center1 />
              </dv-border-box-8>
            </div>
            <div>
              <dv-border-box-1>
                <page1-right1 />
              </dv-border-box-1>
            </div>
          </div>
          <!-- 第四行数据 -->
          <div class="bottom-box">
            <div>
              <dv-border-box-13>
                <page1Bottom1 :project-id="this.projectId - 0" />
              </dv-border-box-13>
            </div>
            <div style="padding-left: 5px">
              <dv-border-box-13>
                <page1Bottom2 :project-id="this.projectId - 0" />
              </dv-border-box-13>
            </div>
          </div>
        </div>

      </div>
    </div>
  </div>
</template>

<script>

  import { formatTime1 } from "@/utils";
  import page1Left1 from '@/views/screen/screen1/page1Left1';
  import page1Center1 from '@/views/screen/screen1/page1Center1';
  import page1Right1 from '@/views/screen/screen1/page1Right1';
  import page1Bottom1 from "@/views/screen/screen1/page1Bottom1";
  import page1Bottom2 from "@/views/screen/screen1/page1Bottom2";

  export default {
    name: "screen1",
    data() {
      return {
        projectId: null,
        timing: null,
        loading: true,
        dateDay: null,
        dateYear: null,
        dateWeek: null,
        weekday: ['周日', '周一', '周二', '周三', '周四', '周五', '周六'],
        decorationColor: ['#568aea', '#000000']
      }
    },
    components: {
      page1Left1,
      page1Center1,
      page1Right1,
      page1Bottom1,
      page1Bottom2
    },
    created() {
      this.projectId = this.$route.query.projectId;
      document.title = this.$route.query.name;
      console.log("可视化大屏一页面执行created方法");
    },
    mounted() {
      this.cancelLoading();
      this.timeFn();
      console.log("可视化大屏一页面执行mounted方法");
    },
    methods: {
      timeFn() {
        this.timing = setInterval(() => {
          this.dateDay = formatTime1(new Date(), 'HH: mm: ss')
          this.dateYear = formatTime1(new Date(), 'yyyy-MM-dd')
          this.dateWeek = this.weekday[new Date().getDay()]
        }, 1000)
      },
      cancelLoading() {
        setTimeout(() => {
          this.loading = false
        }, 5000)
      }
    }
  }

</script>

<style lang="scss" scoped>
  @import "~@/assets/screen/screen1/scss/index.scss";
</style>
